package com.shj.em.biz.sys.service;

import com.shj.em.biz.sys.entity.EmpAmountConf;
import com.shj.em.biz.sys.mapper.EmpAmountConfMapper;
import com.shj.em.biz.sys.service.EmpAmountConfService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;

import com.baomidou.mybatisplus.plugins.Page;
import java.util.List;
import java.util.Map;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;


/**
 * 员工单位时间金额表 服务实现类
 *
 * @author Shen Huang Jian
 * @since 2018-07-30
 */
@Service
@Transactional
public class EmpAmountConfServiceImpl extends ServiceImpl<EmpAmountConfMapper, EmpAmountConf> implements EmpAmountConfService {

    @Autowired
    EmpAmountConfMapper empamountconfMapper;

    public Page<EmpAmountConf> queryEmpAmountConfPage(Map<String, Object> params){
        int offset = (Integer)params.get("offset");
        int pageSize = (Integer)params.get("limit");
        int pageNo = offset / pageSize + 1;
        Page<EmpAmountConf> page = new Page(pageNo, pageSize);
        List<EmpAmountConf> list = empamountconfMapper.queryEmpAmountConfPage(page, params);
        return page.setRecords(list);
    }

    public List<EmpAmountConf> findEmpAmountConfsByDeptId(Long deptId){
        return empamountconfMapper.findEmpAmountConfsByDeptId(deptId);
    }
}
